package org.jeecg.modules.dock.entity.mes.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.jeecg.modules.utils.DockContentUtil;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * MES-WMS发送纵剪叫纸筒
 *
 * @author zhoutong
 */
@ApiModel(value = "MES-WMS发送纵剪叫纸筒", description = "MES-WMS发送纵剪叫纸筒")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class VerticalCuttingIsCalledPaperTubeRequestVO extends MesBaseRequestVO {

    @ApiModelProperty("生产订单号")
    private String orderCode;

    @NotNull
    @ApiModelProperty("明细")
    private List<Detail> detail;

    @Data
    public static class Detail implements Serializable {

        @NotBlank
        @NotNull
        @ApiModelProperty("物料编码")
        private String materialCode;

        @NotBlank
        @NotNull
        @ApiModelProperty("纸筒规格")
        private String spec;

        @NotNull
        @ApiModelProperty("数量")
        private Integer number;

        public void setMaterialCode(String materialCode) {
            this.materialCode = DockContentUtil.addZero(materialCode);
        }

    }

}
